package com.tepth.vehiclemaintenance.mvp.main;

import com.tepth.vehiclemaintenance.base.BaseModel;
import com.tepth.vehiclemaintenance.base.BasePresenter;
import com.tepth.vehiclemaintenance.base.BaseView;
import com.tepth.vehiclemaintenance.bean.VehicleMaintain;
import com.tepth.vehiclemaintenance.net.ApiModel;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * Created by zhangyu on 2017/5/8.
 */

public class MainContract {

    interface View extends BaseView {
        String getAuthKey();

        String getStartTime();
        String getStartDate();
        String getEndDate();

        String getEndTime();
        int getMaintenanceId();

        void showList(ArrayList<VehicleMaintain> list);
        void showNotFinishWorkDates(ArrayList<String> list);
        void workSucceed();
    }

    interface Model extends BaseModel {
        Observable<ApiModel<ArrayList<VehicleMaintain>>> getMainList(String authKey,
                                                                     String startTime,
                                                                     String endTime);
        Observable<ApiModel<ArrayList<String>>> getNotFinishList(String authKey,
                                                              String startDate,
                                                              String endDate);
        Observable<ApiModel<String>> startWork(String authKey,int maintenanceId);
    }

    abstract static class Presenter extends BasePresenter<Model, View> {

        @Override
        public void onStart() {

        }

        abstract void getMainList();
        abstract void getNotFinishList();
        abstract void startWork();
    }
}